import request from '@/utils/request'
import id from "element-ui/src/locale/lang/id";

// 根据商品id查询商品规格信息
export function getSpecsValue(query) {
  return request({
    //  ex6写法url: `/shopping/mallProductSpecs/goodId/${id}`,
    url: '/shopping/mallProductSpecs/getProductIdByProductSpecs',
    method: 'get',
    params: query
  })
}


// 查询商品规格列表
export function listMallProductSpecs(query) {
  return request({
    url: '/shopping/mallProductSpecs/list',
    method: 'get',
    params: query
  })
}

// 查询商品规格详细
export function getMallProductSpecs(id) {
  return request({
    url: '/shopping/mallProductSpecs/' + id,
    method: 'get'
  })
}

// 新增商品规格
export function addMallProductSpecs(data) {
  return request({
    url: '/shopping/mallProductSpecs',
    method: 'post',
    data: data
  })
}

// 修改商品规格
export function updateMallProductSpecs(data) {
  return request({
    url: '/shopping/mallProductSpecs',
    method: 'put',
    data: data
  })
}

// 删除商品规格
export function delMallProductSpecs(id) {
  return request({
    url: '/shopping/mallProductSpecs/' + id,
    method: 'delete'
  })
}
// 删除商品规格
export function logicDelMallProductSpecs(id) {
  return request({
    url: '/shopping/mallProductSpecs/' + id,
    method: 'delete'
  })
}

// 导出商品规格
export function exportMallProductSpecs(query) {
  return request({
    url: '/shopping/mallProductSpecs/export',
    method: 'get',
    params: query
  })
}
